﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>赋值运算符</title>
</head>
<body>
    <script language="JavaScript" type="text/javaScript">
        let param; //定义变量
        param = 8; //给变量赋值
        document.write("给变量param赋值后，param=" + param + "<br>");
        param += 10;
        document.write("对变量进行+= 10操作后，param=" + param + "<br>");
        param -= 4;
        document.write("对变量进行-= 4操作后，param=" + param + "<br>");
        param *= 3;
        document.write("对变量进行*= 3操作后，param=" + param + "<br>");
        param /= 5;
        document.write("对变量进行/= 5操作后，param=" + param + "<br>");
        param %= 3;
        document.write("对变量进行%= 3操作后，param=" + param + "<br>");
        param &= 2;
        document.write("对变量进行&= 2操作后，param=" + param + "<br>");
        param ^= 2;
        document.write("对变量进行^= 2操作后，param=" + param + "<br>");
        param |= 2;
        document.write("对变量进行|= 2操作后，param=" + param + "<br>");
        param <<= 2;
        document.write("对变量进行<<= 2操作后，param=" + param + "<br>");
        param >>= 2;
        document.write("对变量进行>>= 2操作后，param=" + param + "<br>");
        param >>>= 2;
        document.write("对变量进行>>>= 2操作后，param=" + param);
    </script>
</body>
</html>